package cn.wd.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.wd.dao.ShopBatchMapper;
import cn.wd.model.ShopBatch;
import cn.wd.service.ShopBatchService;

@Service
public class ShopBatchServiceImpl implements ShopBatchService {
	@Autowired
	ShopBatchMapper goodsBatchMapper;
	@Override
	public void insertIfNotExist(ShopBatch goodsBatch) {
		ShopBatch batch = goodsBatchMapper.selectByPrimaryKey(goodsBatch.getShopBatch());
		if(batch==null){
			goodsBatchMapper.insertSelective(goodsBatch);
		}
	}
	@Override
	public void insertIfNotExist(String goodsBatch) {
		ShopBatch goodsBatchEntry = new ShopBatch();
		goodsBatchEntry.setShopBatch(goodsBatch);
		insertIfNotExist(goodsBatchEntry);
	}

}
